package erlwitch.tree;

import java.util.ArrayList;
import java.util.List;

public class RecordField extends Term {
	private boolean isVariable;
	private String name;
	private Term value;
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Term getValue() {
		return value;
	}
	public void setValue(Term value) {
		this.value = value;
	}
	public RecordField(int begin, int end, boolean isVariable, String name, Term value) {
		super(begin, end);
		this.isVariable = isVariable;
		this.name = name;
		this.value = value;
	}
	
	public static List<RecordField> addToFieldList(RecordField f, List<RecordField> l) {
		l.add(f);
		return l;
	}
	public static List<RecordField> emptyFieldList() {
		return new ArrayList<RecordField>();
	}
	public static List<RecordField> fieldSingleton(RecordField f) {
		List<RecordField> l = new ArrayList<RecordField>();
		l.add(f);
		return l;
	}
	public boolean isVariable() {
		return isVariable;
	}
	public void setVariable(boolean isVariable) {
		this.isVariable = isVariable;
	}
}
